package org.apache.ocean;

import java.util.Set;
import org.apache.lucene.document.FieldSelector;
import org.apache.lucene.document.FieldSelectorResult;

/**
 *
 * @author jasonr
 */
public class CFieldSelector implements FieldSelector {
  public Set<String> fields;
  
  public CFieldSelector(Set<String> fields) {
    this.fields = fields;
  }
  
  public FieldSelectorResult accept(String fieldName) {
    if (fields.contains(fieldName)) return FieldSelectorResult.LOAD;
    else return FieldSelectorResult.NO_LOAD;
  }
}
